﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FWMS.Service
{
    class ChukumingxiService
    {
        //材料全部查询
        public Bean.Chukuguanli_yuancailiaoBean chukuguanli_ServiceSelect(DateTime dateStart,DateTime dateEnd,int tabIndex)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_yuancailiaoDaoSelect(dateStart, dateEnd, tabIndex);
        }
        //半成品全部查询
        public Bean.Chukuguanli_yuancailiaoBean chukuchengpin_ServiceSelect(DateTime dateStart, DateTime dateEnd, int tabIndex)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_chengpinDaoSelect(dateStart, dateEnd, tabIndex);
        }

        //成品全部查询
        public Bean.Chukuguanli_yuancailiaoBean chukurealchengpin_ServiceSelect(DateTime dateStart, DateTime dateEnd, int tabIndex)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_realchengpinDaoSelect(dateStart, dateEnd, tabIndex);
        }

        //实际使用重量查询
        public string chukushijiZhongliang(string dateStart,string dateEnd,string pinming, string guige, string beizhu, string type)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukushijiZhongliang(dateStart, dateEnd,pinming, guige, beizhu, type);
        }


        //辅料初始化显示用查询
        public Bean.Chukuguanli_tiaoweiliaoBean chukuguanli_ServiceTiaoWeiLiaoSelect(DateTime dateStart, DateTime dateEnd)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_tiaoweiliaoDaoSelect(dateStart, dateEnd);
        }
        
        //出库明细详细查询
        public Bean.Chukuguanli_yuancailiaoBean chukuguanli_ServiceDetailsSelect(Bean.Chukumingxi_yuancailiaoBean bean)
        {
            DAO.Chukuguanli_yuancailiaoDao yuanLiaoDao = new DAO.Chukuguanli_yuancailiaoDao();
            return yuanLiaoDao.chukuguanli_yuancailiaoDaoMingxiCondition(bean);
        }

        //出库调味料查询

        public Bean.Chukuguanli_tiaoweiliaoBean chukuguanli_ServiceDetailsTiaoLiaoSelect(Bean.Chukumingxi_yuancailiaoBean bean)
        {
            DAO.Chukuguanli_yuancailiaoDao yuanLiaoDao = new DAO.Chukuguanli_yuancailiaoDao();
            return yuanLiaoDao.chukuguanli_tiaoweiliaoDaoMingxiCondition(bean);
        }

        //出库辅料查询

        public Bean.Chukuguanli_fuliaoBean chukuguanli_ServiceDetailsFiLiaoSelect(Bean.Chukumingxi_yuancailiaoBean bean)
        {
            DAO.Chukuguanli_yuancailiaoDao yuanLiaoDao = new DAO.Chukuguanli_yuancailiaoDao();
            return yuanLiaoDao.chukuguanli_fuliaoDaoMingxiCondition(bean);
        }

        //出库辅料查询

        public Bean.Chukuguanli_chanpinBean chukuguanli_ServiceDetailsChengpinSelect(Bean.Chukumingxi_yuancailiaoBean bean)
        {
            DAO.Chukuguanli_yuancailiaoDao yuanLiaoDao = new DAO.Chukuguanli_yuancailiaoDao();
            return yuanLiaoDao.chukuguanli_chengpinDaoMingxiCondition(bean);
        }


        public bool chukumingxi_yuancailiaoServicUpdate(Bean.Chukuguanli_yuancailiaoBean bean)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_yuancailiaoDaoUpdate(bean);
        }
        
        //调味料更新出库库存表
        public bool chukumingxi_tiaoWeilLiaoServicUpdate(Bean.Chukuguanli_tiaoweiliaoBean bean)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_tiaoweiliaoDaoUpdate(bean);
        }

        public bool chukuguanli_yuancailiaoServicUpdate(Bean.Chukuguanli_yuancailiaoBean bean,string startDay,string endDay)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukuguanli_yuancailiaoDaoUpdate(bean, startDay, endDay);
        }
        
        //调料出库表更新
        public bool chukuguanli_tiaoweiliaoliaoServicUpdate(Bean.Chukuguanli_tiaoweiliaoBean bean, string startDay, string endDay)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukuguanli_tiaoWeiliaoDaoUpdate(bean, startDay, endDay);
        }

        //辅料更新出库库存表
        public bool chukumingxi_fuLiaoServicUpdate(Bean.Chukuguanli_fuliaoBean bean)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_fuliaoDaoUpdate(bean);
        }
        //半成品更新出库库存表
        public bool chukumingxi_chengpinServicUpdate(Bean.Chukuguanli_chanpinBean bean)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_chengpinDaoUpdate(bean);
        }
        //成品更新出库库存表
        public bool chukumingxi_realchengpinServicUpdate(Bean.Chukuguanli_chanpinBean bean)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.chukumingxi_realchengpinServicUpdate(bean);
        }

        public bool kuchunguanli_update(System.Windows.Forms.DataGridView gridview,string type)
        { 
            DAO.ChukumingxiDao mingxiDao = new DAO.ChukumingxiDao();
            return mingxiDao.kuchunguanli_Update(gridview,type);
        }
        //出库明细按时间段查询
        public Bean.Chukumingxi_yuancailiaoBean mingxi_ServiceSelectByPeriod(DateTime dateStart, DateTime dateEnd,string type)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.mingxi_ServiceSelectByPeriod(dateStart, dateEnd, type);
        }

        //出库明细按集计时间查询
        public Bean.Chukuguanli_yuancailiaoBean mingxi_ServiceSelectByJijiDate(string startDay,string endDay, string type)
        {
            DAO.ChukumingxiDao yuanLiaoDao = new DAO.ChukumingxiDao();
            return yuanLiaoDao.mingxi_ServiceSelectByJijiDate(startDay,endDay, type);
        }
        //出库明细最后时间
        public string mingxiJiJiLastDate( string type)
        {
            DAO.ChukumingxiDao mingxi = new DAO.ChukumingxiDao();
            return mingxi.mingxiJiJiLastDate(type);
        }
        
            //出库明细最后开始时间
        public string mingxiJiJiLastDateStart(string type)
        {
            DAO.ChukumingxiDao mingxi = new DAO.ChukumingxiDao();
            return mingxi.mingxiJiJiLastDateStart(type);
        }

    }
}
